/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pl.cezary.butler.walili.server.db.tasks;

import pl.cezary.butler.walili.common.Task;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Przemysław Bałdyga
 */
// HSQL DB Compatible
//do poprawki - brak zabezpieczenia przed powiązaniami
public class TaskDeleteTask extends UpdateTask {

    private final String CEL;
    private final String POLOZENIE;
    public static final Logger log = Logger.getLogger("ZadanieDeleteTask");

    public TaskDeleteTask(Task z) {
        POLOZENIE = z.getPolozenie();
        CEL = z.getCel();
    }

    @Override
    public void execute() {
        /*try {
            String st = null;
            if (POLOZENIE != null) {
                st = "DELETE FROM (zad_polozenie JOIN zadania_id) JOIN zad_reszta WHERE polozenie LIKE '" + POLOZENIE + "' AND cel LIKE '" + CEL + "'";
            } else {
                st = "DELETE FROM zad_reszta WHERE cel LIKE '" + CEL + "'";
            }
            final Connection c = getConnection();
            Statement que = c.createStatement();
            que.executeUpdate(st);
            que.close();
        } catch (SQLException ex) {
            log.log(Level.SEVERE, "Błąd zapytania Bazy Danych SQL:", ex);
            getIdFactory().fail();
        }*/

    }
}
